<!--
 * @Author: liuYang codkly@gmail.com
 * @Date: 2022-10-26 22:46:47
 * @LastEditors: liuYang codkly@gmail.com
 * @LastEditTime: 2023-01-20 16:45:46
 * @FilePath: \coding\nest\blog_web\components\CardClassify.vue
 * @Description: 
 * 暂无备注
-->
<template>
  <div class="card-box p-2 mb-2 module-bg shadow-sm" v-if="classifyList">
    <a
        class="text-sm m-1 cursor-pointer inline-block"
        @click="onLink(item)"
        v-for="item in classifyList"
        :key="item.id"
    >
      <el-tag>{{ item.name }}</el-tag>
    </a>
  </div>
</template>
<script setup lang="ts">
const pageStore: any = usePageStore();
const router = useRouter();

const res: any = await getClassifyList();
const classifyList = ref(res.data)


const onLink = (nav: string) => {
  pageStore.setName(nav);
  router.push(`/classify/${nav.id}`);
};
</script>
